-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor telemetry to use xarray #134
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Just some minor questions
ict = ds["ICT"].mean(dim="back_scan").data[:, -3:] | ||
space = ds["space_counts"].mean(dim="back_scan").data[:, -3:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could
.data[:, -3:]
be replaced with
.sel(channel_name=slice(-3, None)).data
?
|
||
hmf_array = decode_tele[:, :103].view(dtype=hmf_dtype).squeeze() | ||
prt_counts = xr.DataArray(hmf_array["telemetry"]["PRT"], | ||
dims=["scan_line_index", "PRT_measurement"]) | ||
|
||
# getting ICT counts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could also remove the comments
return potential_tbm_header.copy() | ||
data_set_name = cls._decode_data_set_name(data_set_name) | ||
tbm_header = potential_tbm_header.copy() | ||
tbm_header["data_set_name"] = data_set_name.decode().strip("\x80").encode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the .decode().strip().encode()
part be moved to _decode_data_set_name
?
This PR refactors the telemetry fetching to use xarray, and in the case of POD, the hmf frames are also decoded in a clearer manner.